<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Twin Tulipware</title>
<script type="text/javascript" >

function cari()
{
	var id=document.getElementById('key').value;
	location.href='<?php echo base_url()?>Dealer/searchData/'+id;
}
</script>
<meta name="keywords" content="" />
<meta name="description" content="" />
<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?>

<div id="page1">
<body>
<div id="wrapper">
	<?php $this->load->view('admin_views/header'); ?><hr />
	</div>
	
	<div id="page">
	<div id="page-bgtop">
		<div id="content">
			<div class="post">
				<h2 class="title">dealer </h2>
               <form method="post" action="<?php echo base_url(); ?>dealer/home">
	<table width="500" cellpadding="5" align="center">
<tr>
  <td width="190">Masukkan Nama Dealer </td><td><input type="text" name="nama" size="50" autocomplete="off" /></td></tr>
	
	</table>
	</form>
    <?php
	$banyak = count($nama_dealer->result_array());
	    echo '<tr><td>Ditemukan <b>'.$banyak.'</b> hasil pencarian dengan kata <b>"'.$nama.'"</b></td></tr>'; ?>
		  <table width="90%" border="0" cellpadding="1" cellspacing="1" id="data" align="center">
        <thead>
        <tr  align="center" class="table" >
           <th >No</th>
            <th >Nama</th>
            <th >Upline</th>
            <th >Unit</th>

			<th >Aksi</th>
        </tr>
    </thead>
    <tbody>
	
    <!-- ============isi ============ -->
				
     <?php  $i= 1; ?>
		<?php // foreach($dealer as $m) : 
		if(count($nama_dealer->result_array())>0)
	    {
	        foreach($nama_dealer->result_array() as $nd)
	        {
		
		?>
      	<tr class='data' align='center'>
			<td ><?php echo $i++; ?></td>
			<td align='left'>&nbsp;<?php echo $nd['strnama_dealer']; ?></td>
            <td align='left'>&nbsp;<?php echo $nd['strnama_upline']; ?></td>
            <td align='left'>&nbsp;<?php echo $nd['strnama_unit']; ?></td>
           <td align="center" width="190px">
    <a href="<?php echo base_url()?>dealer/detail/<?php echo $nd['intid_dealer'] ?>" title="Detail data"><img  src="<?php echo base_url()?>images/view.png" align="absmiddle"/> Detail</a>
                   
		   <?php echo anchor ('dealer/edit/'.$nd['intid_dealer'], 'Edit'); ?>| <?php echo anchor ('dealer/delete/'.$nd['intid_dealer'], 'Hapus', array('onClick' =>"return confirm ('Apakah Anda yakin akan menghapus data ')")); ?></td>
        </tr>
		<?php //endforeach; 
		}
	    }
	    else
	    {
	        echo '<tr><td>Tidak ditemukan dealer dengan nama <b>"'.$nama.'"</b></td></tr>';
	    }
		?> 
    </tbody>
</table>
<table width="90%" border="0" cellpadding="1" cellspacing="1" id="data" align="center">
  <tr>
    <td align="left" ><?php echo $paginator; ?></td>
    <td align="right" style="width:75%" ></td>
  </tr>
</table><div id="pager1"></div>  <!--pagination div-->
		  </div>
			</div>
		<!-- end #content -->
		<?php $this->load->view('admin_views/sidebar_master'); ?><!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	<!-- end #page -->
	<div id="footer-bgcontent">
	<?php $this->load->view('admin_views/footer'); ?></div>
	<!-- end #footer -->

</body>
</html>
